import { BasicPageParams, BasicFetchResult, SaaSBasicPageParams } from '/@/api/model/baseModel';

export type RoleParams = {
  roleName?: string;
  roleStatus?: string;
};
export type MenuParams = {
  menuName?: string;
};
export type RolePageParams = BasicPageParams & RoleParams;

export type SaaSRoleParams = {
  // eslint-disable-next-line camelcase
  role_name?: string;
};

export type SaaSRolePageParams = SaaSRoleParams & SaaSBasicPageParams;

export type SaaSRoleDetailParams = {
  // eslint-disable-next-line camelcase
  role_id: string;
};

export interface SaaSUserRoleItem {
  id: string;
  name: string;
}

export interface SaaSRoleListItem {
  id?: string;
  name: string;
  code: string;
  description: string;
  status: boolean;
  createTime?: string;
  isBuiltIn?: string;
  menuId?: string[];
  appId: string;
  appName: string;
}

export type SaaSRoleListGetResultModel = {
  total: number;
  items: SaaSRoleListItem[];
};

export interface SaaSMenuListItem {
  id: string;
  menuName: string;
  orderNo: string;
  parentId: string;
  children: SaaSMenuListItem[];
}

export interface RoleListItem {
  roleId: string;
  roleCode: string;
  roleName: string;
  description: string;
  roleStatus: string;
  createTime: string;
}

export interface MenuListItem {
  id: string;
  menuName: string;
  orderNo: string;
  children: MenuListItem[];
}

export type RoleListGetResultModel = RoleListItem[];
export type RolePageListGetResultModel = BasicFetchResult<RoleListItem>;
export type MenuListGetResultModel = BasicFetchResult<MenuListItem>;
